package com.sskj.one.mine;


import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.one.bean.ListHuiBean;
import com.sskj.one.presenter.BasePresenter;

import java.util.List;

/**
 * @author Hey
 * Create at  2019/05/22
 */
class RecordHuiPresenter extends BasePresenter<RecordHuiActivity> {

    public void getGouHuiRecord(boolean showLoading, int p, int size) {
        httpService.getGouHuiRecord(p, size)
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<ListHuiBean>>>(showLoading ? this : null) {
                    @Override
                    public void onHTTPSuccess(HttpData<List<ListHuiBean>> data) {
                        mView.getRecordOK(data.getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.stopRefresh();
                    }
                });

    }

    public void getJieHuiRecord(boolean showLoading, int p, int size) {
        httpService.getJieHuiRecord(p, size)
        .tag(this)
        .execute(new JsonCallBack<HttpData<List<ListHuiBean>>>(showLoading?this:null) {
            @Override
            public void onHTTPSuccess(HttpData<List<ListHuiBean>> data) {
                mView.getRecordOK(data.getData());
            }

            @Override
            public void onFinish() {
                super.onFinish();
                mView.stopRefresh();
            }
        });
    }
}
